package pl.makimo.fuzzy.linguistics;

import java.util.ArrayList;
import java.util.List;

import pl.makimo.fuzzy.norms.Norm;
import pl.makimo.fuzzy.sets.CompoundFuzzySet;
import pl.makimo.fuzzy.sets.CompoundFuzzySetFactory;

public class CompoundSummarizer<T> extends Summarizer<T> {
	public Summarizer<T> summarizer1;
	public Summarizer<T> summarizer2;
	
	public Norm norm;
	public Norm type2norm;
	
	public List<Summarizer<T>> getSingleSummarizers() {
		List<Summarizer<T>> summarizers = new ArrayList<Summarizer<T>>();
		summarizers.addAll(summarizer1.getSingleSummarizers());
		summarizers.addAll(summarizer2.getSingleSummarizers());
		return summarizers;
	}	

	public CompoundSummarizer(Summarizer<T> summarizer1, Summarizer<T> summarizer2, Norm norm, Norm type2norm) {
		this.summarizer1 = summarizer1;
		this.summarizer2 = summarizer2;
		
		this.norm = norm;
		this.type2norm = type2norm;
		
		this.set = CompoundFuzzySetFactory.make(summarizer1.set, summarizer2.set, norm, type2norm);
	}

	@Override
	public String toString() {
		return summarizer1.toString() + " " + this.norm.toString() + " " + summarizer2.toString();
	}
}
